<?php include_stylesheets_for_form($form) ?>
<?php include_javascripts_for_form($form) ?>

<div class="sf_admin_form">
    <form action="<?php echo url_for('configuracion/update') ?>" method="POST" >
  <?php //echo form_tag_for($form, '@productos') ?>
    <?php //echo $form->renderHiddenFields() ?>

    <?php if ($form->hasGlobalErrors()): ?>
      <?php echo $form->renderGlobalErrors() ?>
    <?php endif; ?>

    <?php //foreach ($configuration->getFormFields($form, $form->isNew() ? 'new' : 'edit') as $fieldset => $fields): ?>
      <?php //include_partial('productos/form_fieldset', array('productos' => $productos, 'form' => $form, 'fields' => $fields, 'fieldset' => $fieldset)) ?>
    <?php //endforeach; ?>

        <?php $name = 'iva' ?><?php //var_dump($form[$name]);exit(); ?>
        <?php //$attributes = $form[$name] //$field->getConfig('attributes', array()) ?>
        <?php //$help = $field->getConfig('help')  ?>
        <?php //$class = 'sf_admin_form_row sf_admin_form_field_'.$name ?>
        <?php $class = 'sf_admin_form_row sf_admin_form_field_'.$name ?>
        <?php if($sf_user->hasCredential('administrador')  || $sf_user->hasCredential('encargado')): ?>
        <!-- FIELDSETS HARDCODEADOS -->
        <?php $nameFs='Venta' ?>
        <fieldset id="sf_fieldset_<?php echo strtolower($nameFs) ?>">
        <h2><?php echo $nameFs ?></h2>
            <?php if($sf_user->hasCredential('administrador')): ?>
                    <?php $name = 'iva' ?>
                  <div class="<?php echo $class ?><?php $form[$name]->hasError() and print ' errors' ?>">
                    <?php echo $form[$name]->renderError() ?>
                    <div>
                      <?php echo $form[$name]->renderLabel() ?>
                      <div class="content">
                              <?php echo $form[$name]->render(/*$attributes instanceof sfOutputEscaper ? $attributes->getRawValue() : $attributes*/); ?>
                      </div>
                      <?php //if ($help): ?>
                        <!--div class="help"><?php //echo __($help, array(), 'messages') ?></div-->
                      <?php //elseif ($help = $form[$name]->renderHelp()): ?>
                        <div class="help"><?php //echo $help ?></div>
                      <?php //endif; ?>
                    </div>
                  </div>
            <?php endif; ?>
            <?php if($sf_user->hasCredential('administrador')  || $sf_user->hasCredential('encargado')): ?>
                        <?php $name = 'descuento' ?>
                      <div class="<?php echo $class ?><?php $form[$name]->hasError() and print ' errors' ?>">
                        <?php echo $form[$name]->renderError() ?>
                        <div>
                          <?php echo $form[$name]->renderLabel() ?>
                          <div class="content">
                                  <?php echo $form[$name]->render(/*$attributes instanceof sfOutputEscaper ? $attributes->getRawValue() : $attributes*/) ?>
                          </div>
                          <?php //if ($help): ?>
                            <!--div class="help"><?php //echo __($help, array(), 'messages') ?></div-->
                          <?php //elseif ($help = $form[$name]->renderHelp()): ?>
                            <div class="help"><?php //echo $help ?></div>
                          <?php //endif; ?>
                        </div>
                      </div>
              <?php endif; ?>

        </fieldset>
        <?php endif; ?>


        <?php if($sf_user->hasCredential('administrador') || $sf_user->hasCredential('encargado')): ?>
        <?php $nameFs='Caja' ?>
        <fieldset id="sf_fieldset_<?php echo strtolower($nameFs) ?>">
        <h2><?php echo $nameFs ?></h2>

                <?php $name = 'caja_inicial' ?>
              <div class="<?php echo $class ?><?php $form[$name]->hasError() and print ' errors' ?>">
                <?php echo $form[$name]->renderError() ?>
                <div>
                  <?php echo $form[$name]->renderLabel() ?>
                  <div class="content">
                          <?php echo $form[$name]->render(/*$attributes instanceof sfOutputEscaper ? $attributes->getRawValue() : $attributes*/) ?>
                  </div>
                  <?php //if ($help): ?>
                    <!--div class="help"><?php //echo __($help, array(), 'messages') ?></div-->
                  <?php //elseif ($help = $form[$name]->renderHelp()): ?>
                    <div class="help"><?php //echo $help ?></div>
                  <?php //endif; ?>
                </div>
              </div>


        </fieldset>
        <?php endif; ?>

    <?php include_partial('configuracion/form_actions', array('configuracion' => $configuracion, 'form' => $form)) ?>
  </form>
</div>
